Projects in parallel each element of a sequence to an IEnumerable{T}, and flattens the resulting
sequences into one sequence. The index of each source element is used in the projected form of
that element.
Namespace:
System.Linq
Assembly:
System.Threading (in System.Threading.dll)
Syntax
Visual Basic (Declaration) |
---|
Public Shared Function SelectMany(Of TSource, TResult) ( _
source As ParallelQuery(Of TSource), _
selector As Func(Of TSource, Integer, IEnumerable(Of TResult)) _
) As ParallelQuery(Of TResult) |
C# |
---|
public static ParallelQuery<TResult> SelectMany<TSource, TResult>(
ParallelQuery<TSource> source,
Func<TSource, int, IEnumerable<TResult>> selector
)
|
Parameters
- source
- Type: System.Linq..::.ParallelQuery<(Of <(TSource>)>)
A sequence of values to project.
- selector
- Type: System..::.Func<(Of <(TSource, Int32, IEnumerable<(Of <(TResult>)>)>)>)
A transform function to apply to each element.
Type Parameters
- TSource
- The type of elements of source.
- TResult
- The type of the elements of the sequence returned by selector.
Return Value
A sequence whose elements are the result of invoking the one-to-many transform
function on each element of the input sequence.
Exceptions
Exception | Condition |
---|
System..::.ArgumentNullException |
source or selector is a null reference (Nothing in Visual Basic).
|
See Also